package com.gz.mylife.im;

import com.zl.smartmall.library.account.IAuth;

import net.tsz.afinal.FinalDb;
import android.content.Context;

public class FirstEnterAppTagDao {
	
	public static void reSet(Context cxt){
		FinalDb mFinalDb = FinalDb.create(cxt);
		mFinalDb.deleteByWhere(FirstEnterAppTag.class, "uid=" + IAuth.getInstance().loadUserInfo().getUid());
		FirstEnterAppTag tag = new FirstEnterAppTag();
		tag.setUid(IAuth.getInstance().loadUserInfo().getUid());
		tag.setIsFirst(1);
		mFinalDb.save(tag);
	}
	
	public static boolean isFirst(Context cxt){
		FinalDb mFinalDb = FinalDb.create(cxt);
		FirstEnterAppTag tag = mFinalDb.getUnique(FirstEnterAppTag.class, "uid=" + IAuth.getInstance().loadUserInfo().getUid());
		if(tag == null){
			return true;
		}else{
			if(tag.getIsFirst() == 1){
				return false;
			}
		}
		
		return true;
	}
}
